import logging
import requests
import app


class PhoneAreaApi(object):

    @classmethod
    def phoneAreaApi(cls, phone):
        """
        获取手机号码归属地
        :param phone: 手机号码
        :return:
        """
        url = app.HOST_URL + '/phonearea.php'
        response = requests.get(url, params={"number": phone})
        logging.info(response.json())
        return response.json()


if __name__ == '__main__':
    print(PhoneAreaApi.phoneAreaApi("18680230856"))
